package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.factorydata.domain.vo.CraftRouteVo;
import lombok.*;

import java.util.Date;

/**
 * 工单信息对象 work_order_info
 *
 * @author ruoyi
 * @date 2025-07-27
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(resultMap = "com.ruoyi.factorydata.mapper.WorkOrderInfoMapper.WorkOrderInfoResult")
public class WorkOrderInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 工单类型
     */
    @Excel(name = "工单类型")
    private String workOrderType;
    /**
     * 工单编号
     */
    @Excel(name = "工单编号")
    private String workOrderCode;

    /**
     * 客户id
     */
    @Excel(name = "客户id")
    private Long customerId;

    /**
     * 负责人
     */
    @Excel(name = "负责人")
    private Long workOrderOwnerId;

    /**
     * 项目id
     */
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 项目编码
     */
    @Excel(name = "项目编码")
    private String projectCode;

    /**
     * 计划id
     */
    @Excel(name = "计划id")
    private Long planId;

    /**
     * 计划编号
     */
    @Excel(name = "计划编号")
    private String planCode;

    /**
     * 生产订单号
     */
    @Excel(name = "生产订单号")
    private String productionOrderNumber;

    /**
     * 优先级(1=紧急, 2=高, 3=中, 4=低)
     */
    @Excel(name = "优先级(1=紧急, 2=高, 3=中, 4=低)")
    private String priority;

    /**
     * 批次编号
     */
    @Excel(name = "批次编号")
    private String batchNum;

    /**
     * 产品BomId
     */
    @Excel(name = "产品BomId")
    private Long productionBomId;

    /**
     * 物料id
     */
    @Excel(name = "物料id")
    private Long materialId;

    /**
     * 产品编码
     */
    @Excel(name = "产品编码")
    private String materialCode;

    /**
     * 产品名称
     */
    @Excel(name = "产品名称")
    private String materialName;
    /**
     * 产品名称
     */
    @Excel(name = "产品类型")
    private String materialType;

    /**
     * 产品规格
     */
    @Excel(name = "产品规格")
    private String materialSpecification;

    /**
     * 计量单位id
     */
    @Excel(name = "计量单位id")
    private Long materialUnit;

    /**
     * 计量单位名称
     */
    @Excel(name = "计量单位名称")
    private String materialUnitName;

    /**
     * 物料分类
     */
    @Excel(name = "物料分类")
    private Long materialCategoryId;

    /**
     * 制造方式
     */
    @Excel(name = "制造方式")
    private String manufacturingMethod;

    /**
     * 工艺路线id
     */
    @Excel(name = "工艺路线id")
    private Long craftRouteId;

    /**
     * 母版id
     */
    @Excel(name = "母版id")
    private Long modelMaterialId;

    /**
     * 母版编号
     */
    @Excel(name = "母版编号")
    private String modelMaterialCode;

    /**
     * 母版库存id
     */
    @Excel(name = "母版库存id")
    private Long modelInventoryId;

    /**
     * 计划开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date plannedStartTime;

    /**
     * 计划结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date plannedEndTime;

    /**
     * 计划数量
     */
    @Excel(name = "计划数量")
    private Integer expectedQuantity;
    /**
     * 实际开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualStartTime;

    /**
     * 实际结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualEndTime;

    /**
     * 实际产量
     */
    @Excel(name = "实际产量")
    private String actualQuantity;
    /**
     * 报废数量
     */
    @Excel(name = "报废数量")
    private String scrapQuantity;


    /**
     * 生产线id
     */
    @Excel(name = "生产线id")
    private Long productionLineId;

    /**
     * 生产线名称
     */
    @Excel(name = "生产线名称")
    private String productionLineName;

    /**
     * 车间id
     */
    @Excel(name = "车间id")
    private Long workshopId;

    /**
     * 车间名称
     */
    @Excel(name = "车间名称")
    private String workshopName;

    /**
     * 当前工序id
     */
    @Excel(name = "当前工序id")
    private Long nowProcessId;

    /**
     * 当前工序编码
     */
    @Excel(name = "当前工序编码")
    private String nowProcessCode;

    /**
     * 当前工序名称
     */
    @Excel(name = "当前工序名称")
    private String nowProcessName;
    /**
     * 当前工序类型
     */
    @Excel(name = "当前工序类型")
    private String nowProcessType;
    /**
     * 工序步骤
     */
    @Excel(name = "工序步骤")
    private Integer nowProcessStep;
    /**
     * 工序负责人
     */
    @Excel(name = "工序负责人")
    private Long nowProcessOrderOwnerId;

    /**
     * 工单状态
     */
    @Excel(name = "工单状态")
    private Integer status;

    /**
     * 暂停状态
     */
    @Excel(name = "暂停状态")
    private Integer suspendStatus;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 工艺路线名称
     */
    @Excel(name = "工艺路线名称")
    @TableField(exist = false)
    private String craftRouteName;

    /**
     * 工单创建人名称
     */
    @Excel(name = "工单创建人名称")
    @TableField(exist = false)
    private String createByName;

    /**
     * 项目运行工单数量
     */
    @Excel(name = "项目运行工单数量")
    @TableField(exist = false)
    private Integer projectRunWorkOrderNum;

    /**
     * 是否任务工单
     */
    @TableField(exist = false)
    private Integer isTask;

    /**
     * 项目负责人
     */
    @Excel(name = "项目负责人")
    private Long projectManagerId;

    /**
     * 项目负责人名称
     */
    @Excel(name = "项目负责人名称")
    private String projectManagerName;
    /**
     * 负责人
     */
    @Excel(name = "负责人")
    @TableField(exist = false)
    private String workOrderOwnerName;
    /**
     * 母版信息
     */
    @TableField(exist = false)
    private ModelInventory modelInventory;

    /**
     * 产品图片
     */
    @Excel(name = "产品图片")
    @TableField(exist = false)
    private String materialImages;

    /**
     * 工艺路线信息
     */
    @TableField(exist = false)
    private CraftRouteVo craftRoute;

    @Excel(name = "客户名称")
    @TableField(exist = false)
    private String customerName;
    @Excel(name = "客户名称")
    @TableField(exist = false)
    private String customerCode;
    @Excel(name = "产品分类名称")
    @TableField(exist = false)
    private String materialCategoryName;

    /**
     * 开工开始时间
     */
    @Excel(name = "开工开始时间")
    @TableField(exist = false)
    private String processStartTime;

    /**
     * 开工开始时间
     */
    @Excel(name = "开工结束时间")
    @TableField(exist = false)
    private String processEndTime;

    @Excel(name = "当前工序负责人名称")
    @TableField(exist = false)
    private String nowProcessOrderOwnerName;

    /**
     * 表征需求
     */
    @Excel(name = "表征需求")
    @TableField(exist = false)
    private String characterizationRequirement;

    /**
     * 外观需求
     */
    @Excel(name = "外观需求")
    @TableField(exist = false)
    private String surfaceRequirement;
    /**
     * 项目目标
     */
    @TableField(exist = false)
    private String target;
    /**
     * 项目附件
     */
    @TableField(exist = false)
    private String projectAttachments;
}